<?php

namespace App\Http\Controllers\Admin;


use App\Http\Controllers\Controller;
use App\Http\Requests\CouponsPost;
use App\Models\Users;
use Illuminate\Http\Request;

use Illuminate\Support\Facades\Hash;
use Tymon\JWTAuth\Facades\JWTAuth;

class AuthorizationsController extends Controller
{




    /**
     * @description 密码登录
     * @param LoginRequest $loginRequest
     * @return \Illuminate\Http\JsonResponse
     * @throws UserException
     */
    public function login(Request $request)
    {

        $users=Users::find(1);

        if (!$token = \Auth::guard('users')->toUser($users)) {
            throw new UserException('用户名或密码错误',3);
        }
        dump($token);

       // return response()->json(['code'=>1,'message' => "fuck"]);
    }

    public function test(Request $request)
    {
        echo "go";
    }

}
